package com.cavas.domain.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cavas.domain.bean.Finance;
import com.cavas.domain.bean.Pret;
import com.cavas.domain.bean.Remboursement;
import com.cavas.domain.dao.DaoFinance;

@Service
@Transactional
public class ServiceFinanceImpl implements ServiceFinance{

	@Autowired
	DaoFinance daoFinance;
	
	public void setDaoFinance(DaoFinance daofinance){
		daoFinance = daofinance;
		
	}
	
	@Override
	public List<Finance> allFinance() {
		return daoFinance.allFinance();
	}
	
	@Override
	public Finance getFinance(String mail) {
		return daoFinance.getFinance(mail);
	}

	@Override
	public int allFdr() {
		return daoFinance.allFdr();
	}

	@Override
	public int allInteret() {
		return daoFinance.allInteret();
	}

	@Override
	public void calculateInteret(Remboursement rbm, Pret pret) {
		daoFinance.calculateInteret(rbm, pret);
		
	}


	@Override
	public void addFinance(Finance finance, int idMembre) {
		daoFinance.addFinance(finance, idMembre);
		
	}

	@Override
	public void deleteFinance(int id) {
		daoFinance.deleteFinance(id);		
	}
	

}
